package com.iotechn.unimall.admin.api.goods;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.LogDO;
import com.iotechn.unimall.data.domain.SpuAttributeDO;
import com.iotechn.unimall.data.domain.SpuDO;
import com.iotechn.unimall.data.dto.GoodsStatisticsDTO;
import com.iotechn.unimall.data.dto.goods.LogDTO;
import com.iotechn.unimall.data.dto.goods.SpuDTO;
import com.iotechn.unimall.data.dto.goods.SpuTreeNodeDTO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;

/**
 * 监理日志
 */
@HttpOpenApi(group = "admin.log", description = "监理管理")
public interface AdminLogService {

    @HttpMethod(description = "创建", permission = "admin:log:create", permissionParentName = "监理管理", permissionName = "监理日志")
    public String create(
            @NotNull @HttpParam(name = "spuDTO", type = HttpParamType.COMMON, description = "商品JSON数据") LogDTO spuDTO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "编辑", permission = "admin:log:edit", permissionParentName = "监理管理", permissionName = "监理日志")
    public String edit(
            @NotNull @HttpParam(name = "spuDTO", type = HttpParamType.COMMON, description = "商品JSON数据") LogDTO spuDTO,
            @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "列表", permission = "admin:log:list", permissionParentName = "监理管理", permissionName = "监理日志")
    public Page<LogDTO> list(
            @HttpParam(name = "shopId", type = HttpParamType.COMMON, description = "搜索分类") Long shopId,
            @HttpParam(name = "shopName", type = HttpParamType.COMMON, description = "搜索标题") String shopName,
            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "") Integer type,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

    @HttpMethod(description = "详情", permission = "admin:log:detail", permissionParentName = "监理管理", permissionName = "监理日志")
    public LogDTO detail(
            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "商品Id") Long spuId,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

    @HttpMethod(description = "根据项目和日期和类型")
    public LogDTO logDetail(
            @HttpParam(name = "shopId", type = HttpParamType.COMMON, description = "项目Id") Long shopId,
            @HttpParam(name = "type", type = HttpParamType.COMMON, description = "类型") Integer type,
            @HttpParam(name = "gmtDay", type = HttpParamType.COMMON, description = "类型") String gmtDay,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

    @HttpMethod(description = "上下架", permission = "admin:log:edit", permissionParentName = "监理管理", permissionName = "监理日志")
    public LogDTO freezeOrActivation(
            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "商品Id") Long spuId,
            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "商品想要变为的状态") Integer status,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "admin:log:delete", permissionParentName = "监理管理", permissionName = "监理日志")
    public String delete(
            @NotNull @HttpParam(name = "spuId", type = HttpParamType.COMMON, description = "商品Id") Long spuId,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;

    @HttpMethod(description = "批量删除", permission = "admin:log:batchdelete", permissionParentName = "监理管理", permissionName = "监理日志")
    public String batchDelete(
            @NotNull @HttpParam(name = "ids", type = HttpParamType.COMMON, description = "商品Id") String ids,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;



}
